<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateStudentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('students', function (Blueprint $table) {
            $table->id();
           $table->unsignedInteger('student_code')->comment('学号');
           $table->string('password',255)->comment('密码');
           $table->string('name')->comment('姓名');
            $table->string('email',50)->default('')
                ->comment('邮箱');
            $table->string('phone',15)->default('')
                ->comment('手机号');
           $table->enum('sex',['未知','男生','女生'])->default('未知')->comment('性别');
           $table->string('class_name',50)->comment('班级');
           $table->unsignedInteger('datum_id')->default(0)->comment('资料');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('students');
    }
}
